fix format syntax & file IO