abstracted out average price calculation based on sample