Added comments to each line explaining what they are and do.