implement file reader