changed x to instance variable (again)