edited twinmon function