renamed k to result_key