Add recursive functions for keys and values