rewrite function for displaying connections