adjusted color measurements, added perfection function