Moved getmessage and showmessage closer to the front, so that the generated