Ported to haxe3