Source code for Capture