converted to haxe3