Now allows use of a lambda function to convert keys