Refactored to use log(1) instead of log(n) implementation of set.  No need to order the values.