Mutexes and Smart pointers added