price calculation now accepts previously calculated totalPrice