mapping mostly working, need to rework distance formula.