implementing the price calculator