added --chats, did some resorting of code
added --chats, did some resorting of code