fix palette layout
fix sorting