Created distance solver