added the initialization of x and y to the constructor