change to use std iterator