moved capture checking to functions, added outlining comment