implementing loops, rather than conditionals -- not finished