added link for weight function