Improved execution speed and added final document.