finished restert code