Changed mode function

Mode function can register a tie in mode when two numbers have the same
mode.