Added documentation and xml comments