finish compute Z.
finish forwardbackward algorithm.