Implemented new class called OrderedLock