Explicit weight function.