Rewrote some of the early solutions