Added some sorting stuff