Cleaned up output of the functions
Switched to dynamically allocated strings to fix filename bug