optimized and fixed errors with color codes.