working for key-value pair