Changed the white balance functions around so that they'll be easier to run through an optimizer later.