Improving leader election algorithm by adding code to make node give up election when receiving a STOP message.