Fixed concurrency problems
Comments, and removed unused imports.