New scoreboard sorting logic and few tests added