Login Functionality Update

Login tested and commented.