prepare to refactor inner marg. attr. loop
turn loop inside out on xresult