key: added compare function.