Added code that will probably work after lock upgrades and degrades work