added compareKey, getKey methods