put file reading code in __init__