Code review

Just doing this so I can comment inline on the code. Don't approve till we're done!