a sequence code implementation in haxe