Imported from CMS program BAM004