Fixed close file bug, finished create_pafig_data