is there a logic error in this code?

Printable View