login stuff, template stuff added