diff --git a/Python/waveform.py b/Python/waveform.py
index 7cbbb11a0d6912ddb3032d68aba6004ee32c6e2c..0097726228fc391ba1ee3f99eb69dca3df746187 100644
--- a/Python/waveform.py
+++ b/Python/waveform.py
@@ -3,7 +3,7 @@ from typing import Dict, Tuple, Any, List
 import numpy as np
 from scipy.interpolate import interp1d
 from AWG import *
-import cupy as cp
+# import cupy as cp
 import scipy.optimize as spopt
 
 
@@ -319,6 +319,8 @@ def get_rearrange_paths(
     :param t_idx: indices of tweezer positions in target pattern.
     :returns: 2d numpy array containing moving path trajectories
     """
+    if len(f_idx) < len(t_idx):
+        return np.array([])
     cm = abs(np.subtract.outer(f_idx, t_idx))
     row, col = spopt.linear_sum_assignment(cm)
     return np.stack([f_idx[row], t_idx]).T