Improved documentation
Added mutexes for message printing