refactoring lattice
better cnpy IO function
merge