store MAX_DISTANCE as a constant