Rafael's updates. Finalizing login.