Added display_image routine and elaborated on resegment