before chat major changes
before major chat changes
restructed chat code a bit