Add documentation and refactored code-style
Resolved merge conflicts