added code for calculating the error term at hidden layer nodes