added some code to generate a quick and dirty sitemap, needs serious refactoring