adding weighted mode.