Feature lattice2

I have addressed the issues. Can you all take another look.Thanks.
Ok (although I don't immediately see the problem ...). I already have used both versions, but after some efficiency benchmarking I opted for the current version. I will now revert back to the deepcopy version. BTW: is it customary in Python to first delete the old object before overwriting the reference?