Adding medprice function.