Added function to parse input data from text file