Changed distance comparison to HHOF