BF: Dan Bliss pointed out a logic error