Layout fixes and code clean up

Palette is in the correct place. Unused layout code removed