updated production version. Includes weight support and tiebreaking.