Cleaned up code, added Chat class