added login, lots of other stuff