Changed addThenGetMostPopular to read and write to different files