added trace for final tree, added method to get final state, fixed bug with '{' char being confused with POS