original

range counter wrong
revised version

range counter corrected