now with tests, and 4-space indents as god intended