Changed login and handling of colors
Corrected updates on threads and synchronised the parts.