improved ALL THE COMMENTS, removed optional caching for the template file, changed how redirects work