started rewrite of login