login and a lot of improvements