Feature lattice2

I have addressed the issues. Can you all take another look.Thanks.
There is a problem here as you delete something from `self.data` while iterating over it.

Maybe all the code in `clone_data` could be replaced with
```
self.data = copy.deepcopy(data)
```
or 
```
self.data = DataContainer(data)
```