Sorts variant building attributes according to their positions