finished second version of login