Erroreous const ref in createRange fixed
Added numeric optimization to createRange