Commented some of the code

Added comments to the code for easier reading