Added login. Structural changes.