working function to calculate total book price