added first version of iterAlgo