changes made to the adding function