updated validatelogin method, added comments, todo's