add exchange feature and stop exchanging if last pixel is exchanged