added idiom functions for list sort and dict build