Add code for derivative of order two