when he peered into the darkness , he heard a scratching noise like the sound of fingernails scraping towards the light , so he pulled the rope until a bucket came into view and small beetles scurried away .