Implementation of Barrier