changed some functions