Fixed an issue with the palette
Cleaned up code, added overlays sub