Added basic login functionality, minor improvements