provided a solution to the assignment