Reverting merged pull

Reverting as the new code was deleting deltas. The code appears to be working, but it's failing to account for existing data.