add function to calculate available volume