Using append and map for simulate-nfa