restructure everything, add python script rewritten from julia