added OpcodeMap and fixed FSM