initial port to Haxe 3