added parallelization, improved color algorithm