fix perceptron learning, add cool utilities