Copying over Peceptron for reused code