Capacity calculation