learn to write the monitor program