Updated some functions