Added the rest of the export code