I have written code to generate lots of lines in an array and made some edits from a previous version to try to speed things up and now I am running into problems with the code