Didn't require to copy into separate vectors. But it makes it easier for the later part of the code to read and debug. Let me know if its okay.