adding weighted prices. changed output