read in parameters and scanning the coord file