Formatting fantastic

Lots of gross functions. May fix them up later. Now to study.