BUG: fix bug in naive algorithm to compute state distributions at nodes