improved scoping/naming for x