Fixed display code, needs testing.