Added test, added docblocks, added docs, code cleanup