added function to calculate deltas for output neurons