First attempt at a working export solution.