This is my final solution to the assignment.