made messages into struct