convert numpy arrays to lists only when needed