switched from HashSet to LinkedHashSet where ordering of elements is
relevant, HashSet doesn't guarantee the ordering of its elements (fixes
#116)