calculating volume in private method