Added message code

Not finished yet