Added some synchronized and removed system out printing