iterator use range to support close/open interval