Rewrote a lot of the pebbling code