keyExist method has been built, still need to test.