now with palette flipping