Stylistic changes: replaced "if logx is not None" with "if logx"