Implemented file handling.