Changed penalty function to compare top 20 nodes.