newx is now dynamic (not hardcoded)