cleaned up function arguments for processmaxpairs