allow input x to be NULL