Changed elif, output bad value