removed fclose to compile