First solution to 3-6
First solution to 3-7. Ugly as sin, but it works. I'll clean it up later.