Fixed comparing current distance with previsous it.
Merge pull request #5 from ktaka/master

Fixed comparing current distance with previsous it.