Adding code documentation and small changes.