Quick fix

Used two if statements, both of which just broke a loop. Just threw them together with ||. Should be slightly faster.