added stringToArray function