fclose and stuff outside while loop
CEIL devNumBlocks