order attributes with primary first
Merge pull request #1 from lperichon/master

order attributes with primary first