Changed the layout of the main template page, made it more flexible