added hasC option and decreased dr used to calculate derivatives