weight_function replaced with weight_key to provide consistency.