Replaced random iteration with sequential one