Added swapping mechanisum