sorting and fixes added.