documentation, pitiful stab at testing, basic cleanup