Performance changes and adding comments to complex code.