changed "count" to "dist"
day 1 of heavy testing, fixed bugs, commented out extra code