switch from attributes to indices