check if swap is possible