Made a magical file output with magical error handling