Added documentation and minor update to PHPDoc