rewrote logic on Prob 4, cutting solving time from 15 seconds down to 0.12 seconds