New version with export