Added login functionality. Need to test it.