Minor modification to find mode.