added ability to store final states in ttree