BPredPerceptron Code cleaned