Completed x_ian function