A few touch-ups. This is still some messy, unordered code.