Need to make sure that the index of 'x' is not the last one