added implementation for file reader