Made changes to functions