no need for result, just use `return expr;` inside the loop and `return NULL;` here at the end.