derivatives calculation is correnct