Continuity of Thurston's length function