updated cover-generating code