changed the derivatives function to include the T-matrix conversion from P to P*