Updated the while implementation. Now with new boolExpr checks