added documentation to the lock mechanism