updated python code as of midday friday october 24th