add private functions like rangecheck