Add documentation to the code and apply coding standars