assignment 2 functions update