Better Perceptron algorithm