Added actual file handler.
Optimized input handling.