fixed function betweenTwoValues