Works but need to check some small differences.  Changes LUT to work in cos space for XC