Implemented error backpropagation. Calculates global error within the method as well. Closes #6.