filled in some functions