added missing return, return percentage instead distance