Minor changes

- Removed redundant loops
- Added some xml documentation