added phpdoc and some code form