Finished the assignment. Update to the final version of the code.