Code for traditional 2PL.