Implemented a first solution to the assignment.