Fixing diff calculation and adding code to decode & test the produced list.
Removing unused code.