s/jQuery.parseXML/DOMParser.parseFromString/
typo
changed distance calculation