generating the lut table instead of hard coding one