reset pos=0 on re-open
elim redundant stores for variables