Modified readfile python script