implemented some more "mutexes"
added many todo comments
fixed some typos
added some additional sanity checks