cleaned up the display code