refactor != -> np.isnan, len(shape) -> ndim
cleaned up tests