Adding a freeInput function
Freeing par->moldatfile after execution