improved popover for matrix