uses lists and for loops