write on loop invariant of peek