PHPDocs style comments

Commented most of the code in these files
Reordered the update files
Cleaned some codes