added support for text message format (allows emoticons); fixed pep8 errors;