primitive resizable arrays; added parallel arrays for storing pairs of primitives efficiently