Fixed issue with switching colors in script + a few changes