reverted change to #! at top of file
the last file count check didn't work properly, I think this one works better.