forgot to make output in every iterations in mode 1