added distance sensor code.