added some comments and tests highlighting the concurrency problems with the previous solution