Le uniche cose che vedo sono gli "and" che andrebbero sostituiti con "&&" e gli "or" che andrebbero sostituiti con "||".

prova!