updated documentation and cleaned up code