added timing to save function