three methods to implement integer swap