final version of range analysis