changed int to Integer in GenerateNewSpatialPairs