Code that I'll use later with mean first passage matrix