samplePath finished, with several cache() to fix recomputation problem