implement paren_check function and tests