Fixes logic with building list of URLs
Removed debugging print stuff
Convert past_urls to serializable structure