Flatten inner linked-list when it reaches a threshold value