Converted arrays to strings, added I/O redirection