quick fix to xtract_irregularity_j and a sort of working xtract_hps