Delta_G:
If none of the pins was low var would keep it's old value. In the output you posted, all the pins read HIGH, so it never went into the if statement and therefore never changed the value of var.
You're right, i had the resistors in the wrong position and that's why the bad lecture. Thank you, now everything is working ok! =D