seperated cBarrier from main