addressed unused code; fixes #15; fixes #16
added pessimistic locking;  fixes #38
Merge pull request #47 from ac21/phase02_bugfixes

Phase02 bugfixes