works in x86 in simulator