canonical path function