tried to fix derivative