Broke up into seperate classes, added documentation.