Hey Eliya, thanks for your reply.
Oooohh that's it... I don't know why but for some reason "push" didn't come to me as I was doing this. Maybe I shoulda got more sleep last night haha... And the "." in a pattern match I did have a line in my script on one of my many many many different attempts that did a regex search and replace, that looked for "." and replaced it with "\." but got a strange result I think. But oh well seems to be working correctly with BrowserUk's example.