typo's, edit for style and a python bug