added mutexes, non blocking server sockets and pseudo code