Working version of ranking, pipeline works upto Ranking