Change the way to output

Change the function printArray to mkString