updated color thresholds, fixed coordinate system