Updated documentation and refactored code to put attributes in their proper place