Using distance sensors