Uploaded solution.

This seems to work. Not the best commit comment ever, but hey, it kind of covers it.