changed vector implementation to C++