adding a mirror function