adding more comments to explain what code does.