Addresses but does not solve #16. This could be used as a sample of how to solve it, though.