Small modifications... I have to read back the original paper for the pebble rearrangement