mirror function.