added vertex tracking for testing distance