diff --git a/HISTORY.rst b/HISTORY.rst
index ffd258caa6603175e1783b8f16b5864b58dd6d5e..e3a5348c48818e486a566df3f5c20c683861af2c 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -17,7 +17,7 @@ History
 
 * Minor fixes of global variables
 
-2018.227 (2018-09-16)
+2018.228 (2018-09-17)
 ------------------
 
 * Python 2.7 & 3.6 compatiblity.
diff --git a/refscrub/__init__.py b/refscrub/__init__.py
index efb2f2d3537888f86e92e8deae10df18ba6be768..41aa9e9d143e7571a17e3ad6b5838e2a20f2049f 100644
--- a/refscrub/__init__.py
+++ b/refscrub/__init__.py
@@ -4,4 +4,4 @@
 
 __author__ = """IRIS PASSCAL"""
 __email__ = 'software-support@passcal.nmt.edu'
-__version__ = '2018.227'
+__version__ = '2018.228'
diff --git a/refscrub/refscrub.py b/refscrub/refscrub.py
index 3d0d7b1768f66741cd55b4777c65464b37a2aded..6e0ff373d826c2c515fedcc1a6ed9204f66e6dd1 100644
--- a/refscrub/refscrub.py
+++ b/refscrub/refscrub.py
@@ -12,6 +12,7 @@ Michael Love
 August 2018
 Updates to work on both Python 2 & 3.
 Code cleanup to match PEP 8.
+Cleanup global vars.
 """
 from __future__ import (print_function, with_statement)
 from os.path import join, basename, getsize
@@ -19,12 +20,11 @@ import sys
 import struct
 
 USAGE = 'usage: %prog [options] infile1 [ infile2 ... infileN]'
-PROG_VERSION = '2018.227'
+PROG_VERSION = '2018.228'
 VERBOSE = False
 EXTRACT = False
 SUMMARY_FILE = 'scrubsum.txt'
 PREFIX = ""
-INFILE = ""
 FILESIZE = 0
 TABS = "\t\t\t\t"
 
@@ -181,18 +181,18 @@ class RTPacket:
             return True
 
 
-def readfile(filename):
+def readfile(infile):
     ticker = 1
     # speedup local vars
     global VERBOSE
     global EXTRACT
-    tell = filename.tell
-    read = filename.read
-    seek = filename.seek
+    tell = infile.tell
+    read = infile.read
+    seek = infile.seek
     while True:
         ticker += 1
         if VERBOSE is False and ticker == 10000:
-            print(summary())
+            print(summary(infile))
             ticker = 1
         if VERBOSE:
             print("OFFSET: %12d" % tell())
@@ -226,16 +226,15 @@ def readfile(filename):
                 print(TABS + ">>>>>>>>")
             seek(-1023, 1)
 
-    print(summary())
+    print(summary(infile))
     # commented out as when run with many files as input like a cf dir the closed fh's need to be written to and isn't
     # smart enough to be opened RTPacket.seen.close_fhs()
 
 
-def summary():
-    global INFILE
+def summary(infile):
     global FILESIZE
     offstring = "%6s: %12d\n"
-    s = offstring % ("OFFSET", INFILE.tell())
+    s = offstring % ("OFFSET", infile.tell())
     s += offstring % ("OF", FILESIZE)
     s += "Good packets: %d = %8.2fMB\n" % (RTPacket.goodpkts, RTPacket.goodpkts / 1024.0)
     s += "IOErrors: %d\n" % RTPacket.IOErrorCount
@@ -247,7 +246,6 @@ def main():
     global VERBOSE
     global EXTRACT
     global PREFIX
-    global INFILE
     global FILESIZE
     summaryfh = None
     from optparse import OptionParser
@@ -275,14 +273,11 @@ def main():
             PREFIX = basename(infilename)
         print("Using prefix %s" % PREFIX)
         FILESIZE = getsize(infilename)
-        with open(infilename) as filename:
-            # with open( filename.name + 'scrub.ref')) as outfile:
-            # import profile
-            # profile.run('readfile(filename)')
-            readfile(filename)
+        with open(infilename) as infile:
+            readfile(infile)
             if options.SUMMARY:
                 summaryfh.write(infilename + ', ' + PREFIX + '\n')
-                summaryfh.write(summary())
+                summaryfh.write(summary(infile))
 
         print("----------------------------------------")
 
diff --git a/setup.cfg b/setup.cfg
index 5e7c599319cc2f99de36655d0e8c55974b82150f..371beb7b759af77d8f94aa900d751bf79f767bd9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 2018.227
+current_version = 2018.228
 commit = True
 tag = True
 
diff --git a/setup.py b/setup.py
index 29be5b23f22655702513362bf7d42aa18cf294b0..288cc8fc627f0e09fb47381efc903de58d87ed87 100644
--- a/setup.py
+++ b/setup.py
@@ -51,6 +51,6 @@ setup(
     packages=find_packages(include=['refscrub']),
     test_suite='tests',
     url='https://git.passcal.nmt.edu/passoft/refscrub',
-    version='2018.227',
+    version='2018.228',
     zip_safe=False,
 )