New weight function.