compareKeys class method