adding moving palette function, needs testing