adds export functionality (broke!)