solution for assignment 1