added modification to keep networks from over training