understanding the message client code step by step