completed perceptron algorithm with simple data test sets