Collin Ernst HW6

If k == r->k you need to update r->data before returning.