Added comments inside file

Comments explain in further detail what is happening throughout the code.