simplified some code in LUT1D reverse