Fix #1

Optimized generation of chosen number of html files