tweaked reader.py