Added capacity function, changed cfg function