adding documentation.
adding the mutex.
adding mutex