Updated file format and exception handling