added more variables and calculation for volume