minor note: should be `return (ret)` according to style(9).