added for loop to initiate a lines and points array to be used dynamically