I believe the script would be efficient if you used > to overwrite the content in king.txt if the username already in that file is not yours!