New pickle based code, needs a lot of debugging.