more correct computation of x and y for packs