FSA tree implementation