Changed calculation to happen in the appropriate space and added back in the lighting calculation for funsies.