Added max distance