changed string output to char array