new versions for the two functions in question 2