more work on paper, comments on python code