Added sort on name part elements - buggy!

Doesn't correctly process whether sort variable is empty.