Added create directory method
Added option to include parameters in header of final summary
Added option to optimize
Create foreground mask directory