new display code, fixes #6