The energetic ups and downs of protein folding