simple loops
generalize types of snippet