added a lookahead before swap statement