frist version only work for large range