variable length arrays don't work with all gcc compilers, so changing these to vectors
remove double parenthesis, eliminating some warnings