Ported to Haxe