changed most functions to return np.complex128 values.