colorized, improved algo