major changes to readfile.py