move from while to 15.times for API