fix #167 by adding capacity attribute to ArrayList