added documentation as well as cleaning up a little bit of the code,
the tables were being poisoned with there dates