basic follow-the-path code