finished export functionality
fixed export