reimplemented dataset and calc_g_delta and calc_h