Updated the code to reflect the new message types and to react properly to kill messages