Added documentation to source code