times method to iterate