added color averageing