David's perceptron