Simplified the CAPTION code