added haskey; changed setkey, getkey functions