barriers use count from constructor instead of template