implement the crawling the pages function