done debugging shared memory and locks
minor changes
fixed some comments