glen != hlen in the func