When starting a new recursion level, start iterating code words using the last code word found, because you're guaranteed not to find a new code word before that (all optimal hamming distances were already found).