added login and changed structure