modetest function

Test for the number of modes