Preliminary comments put in.  Docstrings where appropriate.