Added documentation to code.