Added palette-swapping system
Some auxil work