fixed logRange() to exclude next to last value