Code works when I try to run it in all possible variations, just can't verify it. Please help!