adding some comments, use loop