Formation and structure of the potassium graphites