Better color algorithm