Added export functionality

now works