Tidied up code indentations slightly, put alert after pause command.