Cleaned up some comments and sorted output in template.