Fix parameter passing
Simplify condition