Started work on template, added login/out functions