made critical sections better and more correct
made critical sections better and more correct

Determinant/weaver,sid17/weaver,sid17/weaver,dubey/weaver,dubey/weaver,Determinant/weaver,sid17/weaver,Determinant/weaver,dubey/weaver,sid17/weaver,dubey/weaver,Determinant/weaver