quickly fudged some code to add borders to captions