spruce up code and add losing message