added docs and modified code base