Modified Loops.java per assignment instructions