added synchronized and removed some comments