Added some lines of code, still rebasing the code.