working on the monitor and insert functions