Login added

Merged with abhijeet's code changes. Added the login functionality.