implemented export functionality