Should use more descriptive variables than `$k` and `$v`. On that note, some comments in the function couldn't hurt, either.