Minor reformatting of code
Move variable definitions outside of switch
Be more clear on the lightness we are calculating
Remove opposite class when adding a new one