did everything except calculate distances