working Haxe3 version