changes the function to better reflect what is asked in the assignment