Locks Implemented

All 17 tests now succeed consistently.
Code Cleanup

Removed diagnostic messages and recommented code.