Added comments to each line, describing what the code does.