added ground color algorithm