changed function to accept std::pair when the arguments should be taken together