update to take 3 distance readings and use average, fixes #1