I believe this code worked by chance, redefining it from string to array and