Added sorting of hub bit indexes, so it also works if they are not assending