added haskey functions to the program