some algo changes to get the largest text cluster