didn't commit distance calc breakout from main.js