Kinematic Distance determination code (very simple; adapted from Erik Rosolowsky's)