Added a createPalette function and block methods