add initial and final state parsing