modified Percetron.py and Lattice.py