Added smart_merge function and fixed multiple guesses merger