Added base version of the code
Added documentation
Fixed indentation