more PHPDocs, unused var, small bit code reformatting
more phpdocs and minor check