work on range flatten