migrated to v2. finished some debugging.