added the switch statement to decode opcodes