add an iterator class, later test on it as input (not tested now)