add capacity method and member function