pallette contains too many td, need to reduce number by fixing loop