restructured some of the code, regular chat now working