Added functions to models