calculating amounts