Now creates the final array that can be used. Currently just prints it
though. Probably need to tweak it before just setting it as a return.