dpg2 = (xjp - xjg)2