Added some reading code in main.c, also updated msg code