Changed clock(NULL) -> clock()
Inserted fclose(..)