save table with loop--not understand yet