x should be a local variable