made lock a binary relation
Including locks
Updated to handle locks
Removed the exceptions from the function parameters
Try catch missing finally