implement and test back-propagation algorithm