add Misra-Gries Algorithm