:flower: refactored the code to take number of rows user wants to print the year