Added palette sorting for LSB, does not quite work yet