Minor changes and commenting

Commenting to make the code easier to read
Minor changes