Created detectSOI fcn to scan for the start of files