some perceptron code