changed use to classical pointer array from vector to speed up the program