improve performance a little and add inventory counts to product sorting