Created a function to set the flags passed
Added getFiles function