how to calculate modes - Search