fixed #73
groupchats logic improvements, removed trailing spaces, unused variables, etc