updated to work with Haxe 3, Hash --> Map