code cleanup: simple count and disp working