use vectors instead of arrays