Solves teleportation problem