optimized a bit for using pointers to arrays in lieu of vectors