converted init methods to initWithCapacity to enhance performance