Capture working

Still needs some testing. Missing indirect capture