modified brute use of compareTo to use < and not == between values