finished mirroring functionality