Added input format detection and removed -i