Made changes to add function