replaced unnecessary uses of vector with c array