First version of capture script