organized variable declarations by type
Fixed memory leak
fixed placement of free call to run regardless of file validity