finished math opcodes, added finalize method