Implemented sorting threads according to date. Tested.