Modified Year-wise distribution script (outputfile added).