Added comments to terminal.js