had an error in the terminal states, p1 in too many cases, now I think it is better. Also, the pickling works, but it takes like 30 seconds to unpickle because it is so large...