Converted some arrays to vectors and made them global.