changed reserve to resize in vector initialization