Fixed max and min bug in display distribution