solution to programming assignmenet 2