Changed x to one dimensional array