prints sentences in correct order