extend computation to allow for 1000 lines on the intermediate sheet