reset dist to zero at each step
turned on/off diagnostic messages