Putting all the code into nth-lib
Made changes to reflect new nth-lib