loop changed to rep

the simplest way