Update admin.php

added comments to describe code and fix problems