Translated createCaptureNodes function