reorder invariant and adapt proof
reorder arguments of peek and poke