Updated distance solver

prints out the variable distance