added some functions to models