added nth and reorganizeList functions