what determines the direction of heat flow quizlet