added collector and started work on threads