p9/main.go: Added lengthy writeup, refactored code.