working version of palette