modification to hopfield