refactored FST traversal, fixed bug in FST with insert outputs applied out of order.