revert to previous shortest distance calculation because new way was incorrect