combined some functions - I'm somewhat happy with my functions now. The
functions I leave exposed I feel make sense to be exposed. The functions
that have been combined, cover up some intermediate transformations that
I don't feel need to be exposed as top level functions.

 I also added a bunch of documentation so I remember what things do quickly.