added free function to iterator interface