resize and display utility function implemented