propagate.py updated

updated documentation, cleaned up code for readability.

I had trouble reading it, even.