updated for Haxe 3