Added an example. Added phpdocs.