Documentation

Added comments to all of the PHP code.