Create algorithm of chat span