Problem 5 upload

Initial (and probably final) solution to problem 5.