another shot at traverse generalisation