Add top-level capture() function