switch nth to macro