Added a caption parameter

I added a caption parameter. Thanks for the code.