Never store a pointer to the range val, as it is overwritten in each iteration