where is `cap` initialized?