need separate function for reading file