tidied up toggle_monitor script