Added pathing code from lecture