Rewrote restart as an anonymous function