sorting variables