Added brightness calculation