revamped algorithm in Add
added back in mutex
tracking total count explicitly