Added native and Java emulation mode