color bug fixed for greedy condition 3