what is swap function? why swap function needed? after completing the scope of variable content why jump to swap function?