Made changes to some functions