added sort_keys and fixed doc string