calculating capacity