Fixing bug related to not using width and removing grouping code. the coloring function is the original one