ref multipurpose functions for equalScore and advantageCase()