rewritten capturing in tutorial