adding logic for the do_glance functionality