On part of the code, remove the inline comment to be on top to be easier to read.
Also add some comments on some unclear parts of the code