Updated for different input file with more fields