adeed better edge support
added gps distance function