Reinstated Python threads; indented some areas better