beg nick for some documentation on the locking functions