Comment code

Add comments to the code to describe what each line does