saving the best result in a varialbe