improved current colors sort algorithm