For some reason it is not printing the right solution, but I think my logic is correct? What did I do wrong?