Added input file handling
Added an example parameter file and fixed a memory leak