Update and Export

Updated code to support export.
Added Export feature.