added code for visualizing registration