added messages.h and wrote a message parser