add function
assignment 2