python structure fix