Clean and comment perceptron code