How does friction affect the law of conservation of energy?