finished phpdoc for switch.php. Some conflicts remain.
Explain what $localhost does.
Some preliminary comments for the last two scripts.