Made function out of savecapture