Changing weight implementation so that higher weight values have greater order priority.