add phpdoc comments and updated readme.md