login and changed some functions