code for mirror_driver