The function includes a new `$type` argument, but you don't use it within the updated function.