add crosses function to lines and thereby improve distance function