added file handling
fixed imports