In my example code I mapped the max on 1023 (max of the sensor) and divided the range 0..1023 in equal parts. [that's the theory]
THink you should remap these values to ones that make sense with your sensor, so 850 as max and 200, 400 and 600 as 'midpoints'
Post your code so I can see how you adapted it.