Making the model closer to the Lem model. The calculation of undefined behaviour of unlocks has changed.