fixed the templates.
got popular_posts working
went over my code with a fine-toothed comb