fixed calc of marker dist