trying to code the file parsing logic