A lateral inhibition neural network that emulates a winner-takes-all algorithm