Text loading algorithm