I did not consider that for loop on Ln239 might reduce p2 to an empty list. So here's the modified assert statement to ensure that there's at least 1 element left in p2.