change x.abs() -> np.abs(x)