sorted some functions