Logic changes for the recommendation generation