updated function definition for toHtml method to include optional parame...

...ters and added docblocks (this was causing strict warnings)