Fixed Main template, moved login to top and cleaned up a bit