Modified FindMode ALgorithm