My program seems to run correctly, but it is not satisfying the conditions. Help needed!