little code reformat
Added PHPDocs, removed unused var, update visibility, fix some errors, use perscentage()