completed assignment 4: loop collection