solution to assignment 2 completion