implemented cost function to be optimized in the pointing correction
algorithm
added pointing error correction for pairs