reverting to darran's functions for faster export