replaced repeat fn by repeatedly fn.