Passes 6 of 8 tests now.
Also reformatted quit a bit.